package cn.example.common.protocol.structs;

import lombok.Data;
import java.util.Map;
import cn.hutool.core.map.MapUtil;
import org.artifact.core.lang.DTO;
@Data
/**
 * 聊天信息
 */
public class ChatMsgDTO implements DTO{
	/** 聊天类型 */
	private int chatType;
	/** 发送者 */
	private PlayerInfoDTO sender;
	/** 内容 */
	private java.lang.String content;

	public Map<Object, Object> toMap(Map<Object, Object> map){
		map.put(1437412018,this.chatType);
		map.put(-905962955,this.sender);
		map.put(951530617,this.content);
	    return map;
	}

	public ChatMsgDTO forMap(Map<Object, Object> map){
        this.chatType = MapUtil.getInt(map ,1437412018);
        this.sender = MapUtil.get(map ,-905962955,PlayerInfoDTO.class);
        this.content = MapUtil.getStr(map ,951530617);
        return this;
    }
}